<?php session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
if (isset($_SESSION['lang']))
    require_once "./language_files/subscriberConferencePage_" . $_SESSION['lang'] . ".php";
else
    require_once "./language_files/subscriberConferencePage_en.php";
?>
<html>
    <head>
        <title></title>
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <link href="style3.css" rel="stylesheet" type="text/css" />
        <link href="jquery-ui-all.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="functions.js"></script>
        <?php include 'jquery.php'; ?>
        <script type="text/javascript" src="jquery-accordion.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                check_top();
                $(function() {
                    var more = {autoHeight:false, collapsible: true, navigation: true,
                        clearStyle: true, active: false,
                        change: function(event, ui) {
                            resize_iframe();
                        }
                    };
                    var one = {autoHeight:false,
                         collapsible: true, navigation: true,
                        change: function(event, ui) {
                            resize_iframe();
                        }
                    };
                    if($("#accordion div").length == 1) {
                        $("#accordion").accordion(one);
                    } else {
                        $("#accordion").accordion(more);
                    }
                });
                $(".dismiss").click(function(e){
                    e.preventDefault();
                    var conf = confirm("Are you sure you want to reject this paper?");
                    if(conf == true) {
                        paperID = $(this).attr('paperID');
                        confID = $(this).attr('confID');
                        $.ajax ({
                            data: {paperID:paperID,confID:confID},
                            type: 'POST',
                            url:  'dismiss.php',
                            success: function(response) {
                                alert(response);
                                window.location.href = window.location.href;
                            }
                        });
                    }
                });
                $(".remove").click(function(e){
                    e.preventDefault();
                    var conf = confirm("Are you sure you want to remove this paper?");
                    if(conf == true) {
                        paperID = $(this).attr('paperID');
                        confID = $(this).attr('confID');
                        $.ajax ({
                            data: {paper_id:paperID,conference_id:confID},
                            type: 'POST',
                            url:  'delete.php',
                            success: function(response) {
                                alert(response);
                                window.location.href = window.location.href;
                            }
                        });
                    }
                });
            });
           
        </script>
        <title></title>
    </head>

    <?php
//Author Nathalie Sabty
    //Author Nathalie Sabty
    require_once "functions.php";
    if (isset($_GET['conference_id'])) { // checks if the conference id and member's role in this conference are passed from the previous page
//save each one in a variable
        $member_id = $_SESSION['member_id'];
        $conference_id = intval($_GET['conference_id']);
        //$role=$_GET['role'];
        //establish a database connection
        //get the conference long name and display it on the top of the page
        $conference_name = get_conference_name($conference_id);

        print "<h1>{$conference_name}</h1>";

        //executing the query that retrives the start and end date of the review process and storing them in two variables
        $get_dates = mysql_query("SELECT rev_startDate , rev_endDate
            FROM  conference c
            WHERE  c.conference_id = '$conference_id'") or die(mysql_error());
        $row = mysql_fetch_assoc($get_dates);
        $start = $row['rev_startDate'];
        $end = $row['rev_endDate'];

// getting today's date
        $date = date('Y-m-d');
        $today = date("Y-m-d H:i:s", strtotime($date));
        $get_role = mysql_query("SELECT p.role from privileges p  INNER JOIN member_privileges m ON (m.privileges_id = p.privileges_id)
                WHERE m.member_id = $member_id AND m.conference_id = {$conference_id}") or die(mysql_error());
        // checks the user's role in this conference and  call the function that display the dashboard according to his role
        echo '<div id="accordion">';
        while ($r = mysql_fetch_assoc($get_role)) {
            $role = $r['role'];
            if ($role == 'author') {
                echo '<h3><a href="#">Author</a></h3>';
                echo "<div>";
                AuthorView($member_id, $conference_id, $start, $end, $today);
                echo "</div>";
            } else if ($role == 'organizer') {
                echo '<h3><a href="#">Organizer</a></h3>';
                echo "<div>";
                OrganizerView($conference_id, $end);
                echo "</div>";
            } else if ($role == 'reviewer') {
                echo '<h3><a href="#">Reviewer</a></h3>';
                echo "<div>";
                ReviewerView($member_id, $conference_id, $start, $end, $today);
                echo "</div>";
            }
        }
        echo "</div>";
    }

//mohamed abdel hakim's part
    function CheckResub($paperid) {
        global $lang;
// checking in the database if the input paper_id has more than one version in the database
        // then it was resubmitted else, it is not resubmitted
        $result = mysql_query("SELECT version_id  FROM version v
            INNER JOIN paper p
            ON (p.paper_id = v.paper_id)
            WHERE p.paper_id = {$paperid}") or die(mysql_error());
        if (mysql_num_rows($result) == 1) {
            return "NO";
        } else if (mysql_num_rows($result) > 1) {
            return "YES";
        }
    }

    /* Author Nathalie Sabty
     * this function is called whenever the user is an author in a conference
     * it takes the user's id, conference's id , start , end dates of the review process as well as  today's date as parameters
     * it displays all his papers and each paper's related information and the option to send an email to the organizers
     * There are three condition in this function
      1) the review process didn't start yet
      2) the review process has ended
      3) and during the review process
      in each condition we display the options accesseble in this period
     */

    Function AuthorView($id, $confid, $start, $end, $today) {
        $email = $_SESSION['email'];
        global $lang;
        echo "<fieldset class='options'> <legend><strong>{$lang['option']}</strong></legend>";
// sending email to the organizer button that redirects to the page that does this functinality while sending the conference id
        echo"
	<td><a href='sendEmailForm.php?conference_id={$confid}'>" . $lang['send'] . "</a></td>
        <td><a href='submission2.php?conference_id={$confid}'>" . $lang['submit'] . "</a></td>
	 </tr>";
// printing the tale
        echo '</fieldset>';
        echo "<h2><strong>{$lang['dashboard']}</strong></h2>";
        //execute query that selects data related to authors from the database to display them on the dashboard
        $get_data = mysql_query("SELECT c.category , p.paper_title , p.status  , p.final_rating , p.paper_id , p.date_of_submission
            FROM paper p
            INNER JOIN category c ON (c.category_id = p.category_id)
            WHERE
            (p.author_id =$id OR p.paper_id IN (SELECT paper_id FROM co_authors WHERE author_email = '$email'))
            AND p.conference_id = '$confid' AND p.status != 'deleted'") or die(mysql_error());
        echo '<table width="100%">';
        if (mysql_num_rows($get_data) == 0) {
            echo "<td style='text-align:center; colspan='10'>You didn't submit any paper in this conference</td>";
        } else {
            //doing the checks on the 3 conditions
            if ($today < $start) {
                //displaying the table without the option to rebuttal on the paper

                echo '<tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['resubmit'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['remove'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>Manage Co-authors</b></td>
        </tr>';

                while ($row = mysql_fetch_assoc($get_data)) {
                    /* printing the paper's tilte that redirects to a page where the user can view the pdf ,
                     * the category of the paper , the status , the final rating
                     * buttons to resubmit and remove the paper each one redirects to the page that does this specific functionality
                     */
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    echo "<tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_id={$confid}' target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        <td><a href='resubmitPaper.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['resubmit'] . "</a></td>
        <td><a class='remove' paperID='{$row['paper_id']}' confID='{$confid}' href='#'>" . $lang['remove'] . "</a></td>
            <td><a href='co-authors.php?paper_id={$row['paper_id']}&conference_id={$confid}'>Manage Co-authors</a></td>
        </tr>";
                }
            }
            //checks if the deadline has passed
            else if ($today > $end) {
                // displaying all the options
                echo '
        <tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['FR'] . '</b></td>
		 <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['review'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['rebuttal'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['resubmit'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['remove'] . '</b></td>
             <td style="background-color:#003366; color:white; text-align:center;"><b>Manage Co-authors</b></td>
        </tr>';
                while ($row = mysql_fetch_assoc($get_data)) {
                    /* printing the paper's tilte that redirects to a page where the user can view the pdf ,
                     * the category of the paper , the status , the final rating
                     * buttons to rebuttal , resubmit and remove the paper each one redirects to the page that does this specific functionality
                     */
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    $rating = formatText_safe($row['final_rating']);
                    echo "<tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_id={$confid}' target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        <td>{$rating}</td>
	    <td><a href='startReview.php?paper_id={$row['paper_id']}&conference_id={$confid}' target='_blank'>" . $lang['view'] . "</a></td>
        <td><a href='rebuttal.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['rebuttal'] . "</a></td>
        <td><a href='resubmitPaper.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['resubmit'] . "</a></td>
        <td><a class='remove' paperID='{$row['paper_id']}' confID='{$confid}' href='#'>" . $lang['remove'] . "</a></td>
            <td><a href='co-authors.php?paper_id={$row['paper_id']}&conference_id={$confid}'>Manage Co-authors</a></td>
        </tr>";
                }
            } else {
                echo "<label>Review proccess already started, you can not remove or resubmit your paper.</label>";
                // in this case the user don't have any options as the review process has already started
                echo '
        <tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
         <td style="background-color:#003366; color:white; text-align:center;"><b>Manage Co-authors</b></td>
        </tr>';
                while ($row = mysql_fetch_assoc($get_data)) {
                    /* printing the paper's tilte that redirects to a page where the user can view the pdf ,
                     * the category of the paper , the status , the final rating
                     */
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    echo "<tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_id={$confid}'  target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        <td><a href='co-authors.php?paper_id={$row['paper_id']}&conference_id={$confid}'>Manage Co-authors</a></td>
		       </tr>";
                }
            }
        }
        // Close table
        echo '</table>';
    }

// view reviewing deadline //rana tarek
    function viewReviewingDeadline($confid) {
        global $lang;
        //$currentConfID = '2000'; //for testing the where clause
        $currentConfID = $confid;
        $result1 = mysql_query("SELECT rev_startDate, rev_endDate FROM conference where conference_id= {$currentConfID}")
                or die(mysql_error()); // need conference_id from session
        $row = mysql_fetch_assoc($result1);
        $rEnd = formatText_safe($row['rev_endDate']);
        $rStart = formatText_safe($row['rev_startDate']);
        // rana tarek
        echo "<tr>
        <p> " . $lang['nb'] . " <td> {$rEnd} <br />
        " . $lang['nbS'] . " <td> {$rStart}</td>
        <p/>
        </tr>";
    }

    /* Author Nathalie Sabty
     * this function is called if the user is a reviewe in the conference
     * it takes the user's id, conference's id , start , end dates of the review process as well as  today's date as parameters
     * it displays all his assigned papers and each paper's related information and the options to send an email to the organizers and set limited number of papers
     * There are two condition in this function
      1) during the review process
      2) and before or after the review process
      in each condition only the options accesseble in this period are displayed
     */

    function ReviewerView($id, $confid, $start, $end, $today) {
        global $lang;

        echo '<fieldset class="options" > <legend><strong> ' . $lang['option'] . ' </strong></legend>';

//send email to organizer and set limit papers buttons each redirects to a page passing the conference id
        echo"
	  <tr style='text-align:center;'>
	<td><a href='sendEmailForm.php?conference_id={$confid}'>" . $lang['send'] . "</a></td>
	<td><a href='limitpapers.php?conference_id={$confid}'>" . $lang['set'] . "</a></td>
	 </tr>";
        echo '</fieldset>';
        viewReviewingDeadline($confid);
        echo "<h2><strong>{$lang['dashboard']}</strong></h2>";
        //execute query that selects data related to the reviewer from the database to display them on the dashboard
        $get_data = mysql_query("SELECT category , paper_title , status , p.paper_id
            FROM  category c, paper p , assigned_papers a
            WHERE  c.category_id = p.category_id
            AND a.paper_id = p.paper_id
			AND p.status != 'deleted'
		    AND p.status != 'dismissed'
		  AND a.conference_id = '$confid'
            AND a.member_id ='$id';") or die(mysql_error());

        //checks if today is between the start and end date of the review process
        echo '<table width="100%">';
        if (mysql_num_rows($get_data) == 0) {
            echo "<td style='text-align:center;' colspan='10'>There are no papers assigned to you in this conference</td>";
        } else {
            if ($today >= $start && $today <= $end) {

                //display the columns of the table
                echo '<tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
		 <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['online'] . '</b></td>
	    <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['download'] . '</b></td>
		<td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['offline'] . '</b></td>

        </tr>';

                /* Printing the paper's title that redirects to the page where the user can view the paper ,
                 * the category of the paper , the status
                 * two buttons to start reviewing ( online and offline reviews )  each button redirects to the page where the user can start reviewing and passes the paper's id , conference id
                 */

                while ($row = mysql_fetch_assoc($get_data)) {
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    echo "<tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_fid={$confid}'  target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        <td><a href='startReview.php?paper_id={$row['paper_id']}&conference_id={$confid}' target='_blank'>" . $lang['online'] . "</a></td>
		<td><a href='downloadForReview.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['download'] . "</a></td>
		<td><a href='offlineTemplate.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['offline'] . "</a></td>
        </tr>";
                }
            } else {
                //display the columns of the table
                echo '
        <tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
        </tr>';


                /* Printing the paper's title that redirects to the page where the user can view the paper ,
                 * the category of the paper , the status
                 */

                while ($row = mysql_fetch_assoc($get_data)) {
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    echo "<tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_fid={$confid}'  target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        </tr>";
                }
            }
        }
        echo "</table>";
    }

    /* Author Nathalie Sabty
     * this function is called if the user is an organizer in the conference
     * it takes the conference's id and the end date of the review process as parameters
     * it displays all the papers sumitted to this conference and each paper's related information and the options to send an email to the organizers and set limited number of papers
     * There are two condition in this function
      1) After the review process
      2) before or during
      in each condition only the options accesseble in this period are displayed
     */

    Function OrganizerView($confid, $end) {
        global $lang;
        echo "<fieldset class='options'> <legend> <strong>{$lang['option']}</strong></legend>";
        /* display a table of all the general options that the organizers can access in the conference
         * each one redirects to another page and passes the conference id and the member id wherever needed
         */
        $r = "reviewer";
        $o = "organizer";
        $a = "author";
        echo"
	<td><a href='reviewerInvitations.php?conference_id={$confid}&role={$r}'>" . $lang['InvR'] . "</a></td>
    <td><a href='inviteOrganizers.php?conference_id={$confid}&role={$o}'>" . $lang['InvO'] . "</a></td>
	<td><a href='authorInviataions.php?conference_id={$confid}&role={$a}'>" . $lang['InvA'] . "</a></td>
    <td><a href='reviewOptions.php?conference_id={$confid}'>" . $lang['RevOptions'] . "</a></td>
    <td><a href='callForPapers.php?conference_id={$confid}'>" . $lang['callForPapers'] . "</a></td>
    <td><a href='sessionSetup.php?conference_id={$confid}'>" . $lang['setUp'] . "</a></td>
	 <td><a href='viewMembers.php?conference_id={$confid}'>" . $lang['members'] . "</a></td>
	 <td><a href='postNews.php?conference_id={$confid}'>" . $lang['news'] . "</a></td>
    </tr>";

        echo '</fieldset>';
        echo "<h2><strong>{$lang['dashboard']}</strong></h2>";
        //execute query that selects data related to the organizer from the database to display them on the dashboard
        $get_data = mysql_query("SELECT category , paper_title , status  , paper_id , date_of_submission
            FROM  category c, paper p
            WHERE  c.category_id = p.category_id
		    AND p.status != 'deleted'
		    AND p.status != 'dismissed'
            AND p.conference_id = '$confid'") or die(mysql_error());

        $date = date('Y-m-d');
        $today = date("Y-m-d H:i:s", strtotime($date));
        echo '<table width="100%">';
        if (mysql_num_rows($get_data) == 0) {
            echo "<td style='text-align:center; colspan='10'>There are no papers submitted in this conference</td>";
        } else {
//checks if the deadline has passed
            if ($today > $end) {

                //printing the columns of the table

                echo '<tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['resubmitted'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['date'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['assign'] . '</b></td>
	<td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['review'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['reviewers'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['viewReb'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['dismiss'] . '</b></td>
        </tr>';

                while ($row = mysql_fetch_assoc($get_data)) {
                    // call the function that checks whether this page has been resubmitted or not


                    /* Printing the paper title that redirects to the page where the user can view the pdf ,
                     * the paper's category , the status , the resubmissions and
                     * buttons to assign reviewers , view assigned reviewers , check rebuttals , and dismiss a paper
                     * each button redirects to the page that does this specific functionality and passes the paper id the conference id and the member id wherever needed
                     */
                    $reS = CheckResub($row['paper_id']);
                    $resub = formatText_safe($reS);
                    $Sdate = formatText_safe($row['date_of_submission']);
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    echo "
        <tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_id={$confid}'  target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        <td> {$resub}</td>
        <td>{$Sdate}</td>
        <td><a href='assignReviewer.php?paper_id={$row['paper_id']}&amp;conference_id={$confid}'>" . $lang['assign'] . "</a></td>
		<td><a href='startReview.php?paper_id={$row['paper_id']}&amp;conference_id={$confid}' target='_blank'>" . $lang['view'] . "</a></td>
        <td><a href='ViewAssignedReviewers.php?paper_id={$row['paper_id']}&amp;conference_id={$confid}'>" . $lang['view'] . "</a></td>
        <td><a href='check-rebuttals.php?paper_id={$row['paper_id']}&amp;conference_id={$confid}'>" . $lang['view'] . "</a></td>
        <td><a class='dismiss' paperID='{$row['paper_id']}' confID='{$confid}' href='#'>{$lang['dismiss']}</a></td>
        </tr>";
                }
            } else {
                //display the columns of the table
                echo '
        <tr>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['title'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['cat'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['status'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['resubmitted'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['date'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['assign'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['reviewers'] . '</b></td>
        <td style="background-color:#003366; color:white; text-align:center;"><b>' . $lang['dismiss'] . '</b></td>
        </tr>';

                while ($row = mysql_fetch_assoc($get_data)) {
                    // call the function that checks whether this page has been resubmitted or not
                    /* Printing the paper title that redirects to the page where the user can view the pdf ,
                     * the paper's category , the status , the resubmissions and
                     * buttons to assign reviewers , view assigned reviewers and dismiss a paper
                     * each button redirects to the page that does this specific functionality and passes the paper id the conference id and the member id wherever needed
                     */
                    $reS = CheckResub($row['paper_id']);
                    $resub = formatText_safe($reS);
                    $Sdate = formatText_safe($row['date_of_submission']);
                    $title = formatText_safe($row['paper_title']);
                    $category = formatText_safe($row['category']);
                    $status = formatText_safe($row['status']);
                    echo "
        <tr>
        <td><a href='viewSubmissions.php?paper_id={$row['paper_id']}&conference_id={$confid}'  target='_blank'>{$title}</a></td>
        <td>{$category}</td>
        <td>{$status}</td>
        <td> {$resub}</td>
        <td>{$Sdate}</td>
        <td><a href='assignReviewer.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['assign'] . "</a></td>
        <td><a href='viewAssignedReviewers.php?paper_id={$row['paper_id']}&conference_id={$confid}'>" . $lang['view'] . "</a></td>
       <td><a class='dismiss' paperID='{$row['paper_id']}' confID='{$confid}' href='#'>{$lang['dismiss']}</a></td>
        </tr>";
                }
            }
            // Close table
        }
        echo '</table>';
    }
    ?>
